From dcd2c4bddfb5682ef0206aed02d5ae3086a25615 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Fri, 21 Feb 2025 13:47:00 +0100 Subject: [PATCH] ensure we can delete invalid read-only items Signed-off-by: Matthieu Gallien --- src/gui/folder.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 85e004995..cc5a0f74a 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -1736,7 +1736,16 @@ void Folder::slotNeedToRemoveRemnantsReadOnlyFolders(const QList_file); +#if !defined(Q_OS_MACOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15 + const auto fileInfo = QFileInfo{localPath + oneFolder->_file}; + const auto parentFolderPath = fileInfo.dir().absolutePath(); + const auto parentPermissionsHandler = FileSystem::FilePermissionsRestore{parentFolderPath, FileSystem::FolderPermissions::ReadWrite}; +#endif + if (oneFolder->_type == ItemType::ItemTypeDirectory) { + FileSystem::removeRecursively(localPath + oneFolder->_file); + } else { + FileSystem::remove(localPath + oneFolder->_file); + } } callback(true); setSyncPaused(false); -- 2.30.2